package com.treasure.mall.zbq.common.ienum.community;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.treasure.mall.zbq.common.constant.Constant;
import com.treasure.mall.zbq.common.ienum.base.CodeDescCommonEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

public interface CommunityEnums {

    /**
     * 内容类型
     */
    @Getter
    @AllArgsConstructor
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum ContentType implements CodeDescCommonEnum {

        IMAGE_TEXT(0, "图文"),
        VIDEO_TEXT(1, "视频");
        private Integer code;
        private String desc;
    }


    /**
     * 审核状态
     */
    @Getter
    @AllArgsConstructor
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum AuditStatus implements CodeDescCommonEnum {

        WAIT(0, "待审核"),
        SUCCESS(1, "审核通过"),
        ERROR(2, "审核拒绝");
        private Integer code;
        private String desc;


        public String statusClass() {
            switch (this) {
                case WAIT:
                    return Constant.COLOR_WARNING;
                case SUCCESS:
                    return Constant.COLOR_DANGER;
                default:
                    return Constant.COLOR_PRIMARY;
            }
        }
    }

    /**
     * 评论内容类型
     */
    @Getter
    @AllArgsConstructor
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum CommentsContentType implements CodeDescCommonEnum {
        COMMUNITY_ARTICLE(0, "社区文章");
        private Integer code;
        private String desc;
    }

}
